package com.spzx.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spzx.domain.Brand;
import com.spzx.product.mapper.BrandMapper;
import com.spzx.product.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 品牌Service业务层处理
 */
@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements IBrandService {
    @Autowired
    BrandMapper brandMapper;

    @Override
    public List<Brand> list(Integer pageNum, Integer pageSize) {
        return brandMapper.list(pageNum, pageSize);
    }

    @Override
    public int add(Brand brand) {
        return brandMapper.insert(brand);
    }

    @Override
    public int delete(Long id) {
        return baseMapper.deleteById(id);

    }

    @Override
    public int updateBrand(Brand brand) {
        return baseMapper.updateById(brand);
    }

    @Override
    public Brand selectBrandById(Long id) {
        return baseMapper.selectById(id);

    }
}
